This file is a Mathematica Notebook that gives some examples of what Mathematica can do. For information on how to read this Notebook, see the file Read This First!
This file is loosely based on Chapter 0 of The Mathematica Book: "Mathematica: A System for Doing Mathematics by Computer", by Stephen Wolfram. This book was published by Addison-Wesley in 1988, and is available at most bookstores. For information on how to obtain copies of Mathematica itself, see the section "Buying Mathematica" in the file Read This First!
The first line here is what you type into Mathematica. The second line is the result Mathematica gives. If you are reading this Notebook on a color system, the input and output are blue, with the input in boldface.
It is a fact of mathematics that there is no way to get an exact formula for the solutions of a quintic equation like this. You can nevertheless ask Mathematica to give you numerical results. You get the five complex number roots to the equation.
Mathematica generates all graphics in PostScript, so that you can resize pictures, and make use of the resolution available on different types of printers. (Note, however, that to save disk space the graphics in this Notebook have been converted into bitmap images, which have lower resolution and do not look as good when resized or printed. The ability to convert images into bitmap form is useful when space is at a premium, and for animations, which are normally not printed.)
You can use sequences of graphics cells in a Notebook as frames in a "movie". To show a movie, you select its sequence of cells (by clicking the bracket that encloses all of them), then type Y. The movie appears in the first graphics cell you have selected. The movie is produced by showing in rapid succession the graphics cells in the selected sequence. A click anywhere inside the window will stop the animation.
This Notebook contains a sample of animation in Mathematica. Due to disk space limitations, this is a very simple two-dimensional example. Look in the "Animations" folder on your disk for other examples of animated graphics.
What follows is an animation showing how the curve of a Bessel function changes with the order of the Bessel function. (The movie looks best when run fairly slowly, with the frames shown cyclically.)
The Unformatted text for this cell was not generated.
Use options in the Actions Settings dialog box to control
when Unformatted text is generated.
;[o]
-Graphics3D-
:[font = text; inactive; ]
This shows the dodecahedron as a three-dimensional graphical object.
As another example, we can use the definitions from the polyhedra package to create an image of a stellated icosahedron, which is often used as an icon for the Mathematica system.
There are several styles of programming in Mathematica. One of them is procedural programming, as you would find in a standard structured programming language such as C or Pascal.
Another is "rule-based programming". The idea is to give transformation rules which specify how Mathematica should transform expressions it receives as input.
You can give rules that mimic the formulas you might find in a mathematics textbook.
Here is an example of how you might teach Mathematica about a new form of logarithm function, called nlog.
Mathematica consists of two parts — the "Kernel", which actually does computations, and the "Front End", which deals with interaction with the user. The Kernel of Mathematica is essentially the same on all computers that support Mathematica. The Front End, on the other hand, works differently on different kinds of computer.
On the Macintosh, Mathematica has a sophisticated Front End that takes advantage of the Macintosh's unique user interface capabilities. (You can actually use the Macintosh Front End even if you are using a "remote Kernel", say on a supercomputer connected through a network.)
One of the most important aspects of the Macintosh Front End is its ability to support Mathematica "Notebooks".
This file is an example of a Notebook. Notebooks consist of a mixture of text, graphics, and Mathematica input.
Notebooks can be used like "interactive textbooks" — you read the text in the Notebook, then use the Mathematica input in the Notebook to perform calculations.
This Notebook defines the functions PointPlot, PointPlot3D, PointParamPlot3D, SpaceCurve, and PointSpaceCurve. These functions let you make discrete point plots in two and three dimensions. The SpaceCurve and PointSpaceCurve functions let you make three-dimensional functions of one parameter (lines or points in 3D).
Each of the functions defined in this Notebook is a variation of either Plot, Plot3D, or ParametricPlot3D. The arguments are quite similar to these standard functions. Following are descriptions of each of the functions.